import { validateNumberFixed2, validateNumberFixed } from '/@/utils/validators';
import request from '/@/api/project/order/index';
import commonRequest from '/@/api/common/common';
import { i18n } from '/@/locales/i18n';
const $t = i18n.global.t;

export default function (data: any) {
	const array = [
		{
			type: 'select',
			label: $t('xiangMuBianHao'),
			key: 'projectNo',
			value: data.projectNo || '',
			rules: [{ required: true, message: $t('qingXuanZeXiangMuBianHao'), trigger: 'blur' }],
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
			watch: true,
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getProjectInfoList,
				searchKey: 'projectNo',
				value: 'projectNo',
				label: 'projectNo',
				//以后这种多关联的数据,可以考虑使用pinia更加的灵活!!
				fill: {
					//jobNum是当前选中对象的key, staffID是关联的其他组件id
					// staffID: 'jobNum',
					projectName: 'projectName',
					projectSite: 'fieldName',
					proStartRealTime: 'proStartRealTime',
					proEndRealTime: 'proEndRealTime',
					ProHalfRealTime: 'ProHalfRealTime',
					//如果一个数据既需要双向绑定(el-slider),有需要和原始值比较大小, 最简单的方法声明两个属性!!
					proProcess: 'proProcess', //这是用来双向绑定的数据
					//使用一个原始key来保存,初始化的数据,比较大小
					oldProcess: 'proProcess',
				},
				otherParams: {
					pageSize: 10000,
					pageNo: 1,
				},
				showMore: [
					{
						key: 'projectName',
						label: $t('xiangMuMingCheng'),
					},
				],
			},
		},

		{
			type: 'input',
			label: $t('xiangMuMingCheng'),
			key: 'projectName',
			value: data.projectName || '',
			disabledStyle: true,
			rules: [{ required: true, message: $t('qingXuanZeXiangMuBianHao_0'), trigger: 'blur' }],
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},

		{
			type: 'input',
			label: $t('kaoQinGuiShuDi'),
			key: 'projectSite',
			value: data.projectSite || '',
			rules: [{ required: true, message: $t('qingXuanZeXiangMuBianHao_1'), trigger: 'blur' }],
			disabledStyle: true,
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'input',
			label: $t('riQi'),
			key: 'date',
			value: data.date || '',
			disabledStyle: true,
		},

		{
			type: 'select',
			label: $t('shenHeLiuCheng'),
			labelWidth: '130px',
			key: 'operationID',
			value: '',
			placeHolder: $t('keShuRuGuanJianZiChaZhao'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getCheckList,
				searchKey: 'checkflowName',
				value: 'id',
				label: 'checkFuncname',
				otherParams: {
					checkFuncname: $t('gongZuoRiBao'),
				},
				// fill: {
				// 	OperationID: 'id',
				// },
			},
			rules: [{ required: true, message: $t('shenHeLiuChengMingChengBuNengWeiKong'), trigger: ['blur', 'change'] }],
		},

		{
			type: 'date',
			label: $t('shiJiKaiGongRiQi'),
			key: 'proStartRealTime',
			value: '',
			dateOption: {
				dataFormat: 'YYYY-MM-DD',
			},
		},
		{
			type: 'date',
			label: $t('shiJiWanGongGuoBanRiQi'),
			labelWidth: '130px',
			key: 'ProHalfRealTime',
			value: data.ProHalfRealTime || '',
			dateOption: {
				dataFormat: 'YYYY-MM-DD',
			},
		},
		{
			type: 'date',
			label: $t('shiJiWanGongRiQi'),
			key: 'proEndRealTime',
			value: data.proEndRealTime || '',
			dateOption: {
				dataFormat: 'YYYY-MM-DD',
			},
		},
		{
			type: 'upload',
			label: $t('fuJian'),
			key: 'filesBase64',
			value: [],
			uploadOption: {
				multiple: false,
				limit: 1,
			},
		},
		// {
		// 	type: 'upload',
		// 	label: '附件',
		// 	key: 'attachmentPath',
		// 	labelWidth: '130px',
		// 	value: [],
		// 	uploadOption: {
		// 		multiple: false,
		// 		limit: 1,
		// 	},
		// },

		{
			type: 'slot',
			slotName: 'proProcess',
			key: 'proProcess',
			value: data.proProcess || 0,
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},

		{
			type: 'slot',
			slotName: 'workHours',
			key: 'workHours',
			value: [
				{
					StaffID: '',
					StaffName: '',
					DutyHours: '',
					ExtraHours: '',
				},
			],
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'slot',
			slotName: 'tint1',
			label: $t('xiangMuXiangXiZhuangKuangMiaoShu'),
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'slot',
			slotName: 'theset_QU',
			key: 'theset_QU',
			value: '',
			size: {
				xs: 3,
				sm: 3,
				md: 3,
				lg: 3,
				xl: 3,
			},
		},
		{
			type: 'textarea',
			label: $t('xianChangRenYuanMeiRiGongZuoAnPai'),
			key: 'theset',
			value: data.theset || '',
			placeHolder: $t('tianXieDangTianXiangMuShiGongRenYuanDeAnPaiWaiBaoJinChangRenShuShiFouManZuXiangMuShiGongXuQiu'),
			size: {
				xs: 21,
				sm: 21,
				md: 21,
				lg: 21,
				xl: 21,
			},
		},
		{
			type: 'slot',
			slotName: 'materialComing_QU',
			key: 'materialComing_QU',
			value: '',
			size: {
				xs: 3,
				sm: 3,
				md: 3,
				lg: 3,
				xl: 3,
			},
		},
		{
			type: 'textarea',
			label: $t('laiLiaoZhuangKuang'),
			key: 'materialComing',
			value: data.materialComing || '',
			placeHolder: $t('miaoShuCaiLiaoHuoSheBeiShiFouAnXuQiuDaoXianChangZhengChangQingKuangKeBuTianXie'),
			size: {
				xs: 21,
				sm: 21,
				md: 21,
				lg: 21,
				xl: 21,
			},
		},
		{
			type: 'slot',
			slotName: 'quality_QU',
			key: 'quality_QU',
			value: '',
			size: {
				xs: 3,
				sm: 3,
				md: 3,
				lg: 3,
				xl: 3,
			},
		},
		{
			type: 'textarea',
			label: $t('zhiLiangZhuangKuang'),
			key: 'quality',
			value: data.quality || '',
			placeHolder: $t('dangRiShiGongShiFouYouZhiLiangYiChangBingShuoMingZhengChangQingKuangKeBuTianXie'),
			size: {
				xs: 21,
				sm: 21,
				md: 21,
				lg: 21,
				xl: 21,
			},
		},

		{
			type: 'slot',
			slotName: 'progressStatus_QU',
			key: 'progressStatus_QU',
			value: '',

			size: {
				xs: 3,
				sm: 3,
				md: 3,
				lg: 3,
				xl: 3,
			},
		},
		{
			type: 'textarea',
			label: $t('jinDuZhuangKuang'),
			key: 'progressStatus',
			value: data.progressStatus || '',
			placeHolder: $t('jinDuShiFouManZuGongQiYaoQiuMiaoShuYuYaoQiuGongQiDeChaJuZhengChangQingKuangTianXieShiJiJinDuBaiFenBi'),
			size: {
				xs: 21,
				sm: 21,
				md: 21,
				lg: 21,
				xl: 21,
			},
		},
		{
			type: 'slot',
			slotName: 'security_QU',
			key: 'security_QU',
			value: '',
			size: {
				xs: 3,
				sm: 3,
				md: 3,
				lg: 3,
				xl: 3,
			},
		},
		{
			type: 'textarea',
			label: $t('anQuanZhuangKuang'),
			key: 'security',
			value: data.security || '',
			placeHolder: $t('sheJiXiangMuShiGongZhongSheJiAnQuanHuanJingJiJianKangFangMianShiFouYouYiChangXianChangCaiLiaoGongJuJiQiTaWuPinDeDuiFangShiGongGuoChengDeZhiXuShiFouYouYiChangJiDuiShiGongDeYingXiangZhengChangQingKuangKeBuTianXie'),
			size: {
				xs: 21,
				sm: 21,
				md: 21,
				lg: 21,
				xl: 21,
			},
		},
		{
			type: 'slot',
			slotName: 'customerComplaints_QU',
			key: 'customerComplaints_QU',
			value: '',
			size: {
				xs: 3,
				sm: 3,
				md: 3,
				lg: 3,
				xl: 3,
			},
		},
		{
			type: 'textarea',
			label: $t('keHuFanKuiQingKuang'),
			key: 'customerComplaints',
			value: data.customerComplaints || '',
			placeHolder: $t('tianXieDangRiJiaFangDuiGongSiJiuShiGongGuoChengZhongSuoTiJiDeYiYiHeYaoQiuYiJiDuiXiangMuDeYingXiangZhengChangQingKuangKeBuTianXie'),
			size: {
				xs: 21,
				sm: 21,
				md: 21,
				lg: 21,
				xl: 21,
			},
		},
		{
			type: 'textarea',
			label: $t('beiZhu'),
			key: 'description',
			value: data.description || '',
			placeHolder: $t('qiTaYiChangQingKuangZaiCiTianXieZhengChangQingKuangKeBuTianXie'),
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
	];
	return array;
}
